/**
  CNOK project, Anyang Normal University, IMP-CAS
  \class TARandom
  \brief random number generator based on C++11 standard library
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2022/12/02
  \date Last modified: 2022/12/02 by SUN Yazhou
  \copyright 2020-2023 SUN Yazhou
  \copyright CNOK project, Anyang Normal University, IMP-CAS
*/

#ifndef _TARandom_h_
#define _TARandom_h_

#include <random>

class TARandom{
public:
  TARandom();
  virtual ~TARandom();

  void SetSeed(unsigned s = 9999); ///< s=9999, set to frd()

  double Uniform(double x = 1){ return Uniform(0, x); }
  double Uniform(double x1, double x2); ///< [0,1] uniform distri.

  double Gaus(double mean = 0, double sigma = 1);
  int Binomial(int ntot, double prob);

protected:
  /// random number engine //
  std::random_device frd; ///< seed from linux entropy pool
  std::mt19937 fmt; ///< Mersenne twister
};

#endif
